﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<FeaturesBlog.Models.Post>" %>
<%@ Import Namespace="FeaturesBlog.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Create
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Create</h2>

<%if (HttpContext.Current.User.Identity.IsAuthenticated)
      { %>
    <div id="createPost">
        <% using (Html.BeginForm())
           {%>
        <%= Html.ValidationSummary(true)%>
        <fieldset>
            <legend>Post</legend>
            
            <div class="editor-label">
                Subject:
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => (model).PostSubject, new { style = "width:100%" })%>
              </div>
            <div class="editor-label">
                Body:
            </div>
            <div class="editor-field">
                <%= Html.TextAreaFor(model => (model).PostBody, new { style = "width:100%; height:100px" })%>
            </div>
            <div style="text-align:left">
                <input type="submit" value="Create" onclick="return ($('#PostSubject').attr('value') != '' && $('#PostBody').attr('value') != '')" />
                <input type="button" value="Cancel" onclick="document.location.href='/Home';return false;"/>
            </div>
        </fieldset>

        <% } %>
    </div>
    <% } %>
</asp:Content>

